import request from "@/utils/request";

import { baseUrlConfig } from "@/config/config";
const basePath = baseUrlConfig.processBaseUrl;

export interface PageListType {
  pageNum?: number;
  pageSize?: number;
}
// 巡查项目下拉
export const getsupervisionProject = () => {
  return request({
    url: basePath + "/cm/Supervision/supervisionProject",
    method: "get",
  });
};
// 监管列表下拉框
export const getsupervisionList = () => {
  return request({
    url: basePath + "/cm/Supervision/supervisionList",
    method: "get",
  });
};
//网格区域统计
export const getgroupByGrid = () => {
  return request({
    url: basePath + "/cm/Supervision/groupByGrid",
    method: "get",
  });
};
//航站楼统计
export const getgroupByTerminal = () => {
  return request({
    url: basePath + "/cm/Supervision/groupByTerminal",
    method: "get",
  });
};
//查询
export const getapplyList = (payload: any) => {
  const { pageNum, pageSize, ...data } = payload;
  return request({
    url:
      basePath +
      "/cm/Supervision/applyList?" +
      "pageNum=" +
      pageNum +
      "&pageSize=" +
      pageSize,
    method: "post",
    data: data,
  });
};
//查看
export const getFormAndFeedback = (id: any) => {
  return request({
    url: basePath + "/cm/supervisoryForm/getFormAndFeedback/" + id,
    method: "get",
  });
};

//导出
export const Supervisionexport = (data: any) => {
  return request({
    responseType: "blob",
    url: basePath + "/cm/Supervision/export",
    method: "post",
    data: data,
  });
};
//新增施工监管单
export const supervisoryFormappendyu = (data: any) => {
  return request({
    url: basePath + "/cm/supervisoryForm/append",
    method: "post",
    data: data,
  });
};
//创建人
export const supervisionCreator = () => {
  return request({
    url: basePath + "/cm/Supervision/supervisionCreator",
    method: "get",
  });
};
